﻿<UserControl x:Class="AzureVMDashboard.UI.VMDetailControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:ui="clr-namespace:AzureVMDashboard.UI"
             mc:Ignorable="d" 
             Background="{StaticResource BlueAzure}"
             Margin="0,0,0,0"
             d:DesignHeight="300" d:DesignWidth="300">
    <UserControl.Resources>
        <ui:VMStatusToColorConverter x:Key="VMStatusToColor" />
        <ui:VMStatusToTooltipConverter x:Key="VMStatusToTooltip" />
    </UserControl.Resources>
    <Grid Margin="10,5,5,5">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="70"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="140" />
            <RowDefinition Height="20" />
            <RowDefinition Height="20" />
            <RowDefinition Height="20" />
            <RowDefinition Height="20" />
            <RowDefinition Height="20" />
            <RowDefinition Height="20" />
            <RowDefinition Height="20" />
            <RowDefinition Height="20" />
            <RowDefinition Height="20" />
        </Grid.RowDefinitions>
        <Border CornerRadius="5" Background="White" BorderThickness="3" BorderBrush="Gainsboro" Grid.Row="0" Grid.Column="0"  Grid.ColumnSpan="2" >
            <StackPanel>
                <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" Grid.Row="1" Grid.Column="1" Text="{Binding VM.Name}" Foreground="{StaticResource BlueAzure}" FontSize="30" />
                <!--<Image Margin="0,10,0,0" Source="/Resources/vm_generic.png" Width="90" Height="90" Stretch="Fill"/>-->

                <Rectangle Fill="{Binding VM.Status, Converter={StaticResource VMStatusToColor}}"
                       Opacity="0.7" Width="150" Height="80">
                    <Rectangle.OpacityMask>
                        <VisualBrush Visual="{StaticResource appbar_cloud}" Stretch="Fill" />
                    </Rectangle.OpacityMask>
                </Rectangle>

                
            </StackPanel>
        </Border>


        <TextBlock Grid.Row="1" Grid.Column="0" Text="Service:"  />
        <TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding VM.ServiceName}" Style="{StaticResource ImportantText}"  />

        <TextBlock Grid.Row="2" Grid.Column="0" Text="State:"  />
        <TextBlock Grid.Row="2" Grid.Column="1" Text="{Binding VM.Status}" Style="{StaticResource ImportantText}"  />

        <TextBlock Grid.Row="3" Grid.Column="0" Text="IP:"  />
        <TextBlock Grid.Row="3" Grid.Column="1" Text="{Binding VM.LocalIPAddress}" Style="{StaticResource ImportantText}"  />

        <TextBlock Grid.Row="4" Grid.Column="0" Text="Size:"  />
        <TextBlock Grid.Row="4" Grid.Column="1" Text="{Binding VM.Size}" Style="{StaticResource ImportantText}"  />

        <TextBlock Grid.Row="5" Grid.Column="0" Text="FQDN:"  />
        <TextBlock Grid.Row="5" Grid.Column="1" Text="{Binding VM.FQDN}" Style="{StaticResource ImportantText}"  />
        
        <TextBlock Grid.Row="6" Grid.Column="0" Text="RDP Port:"  />
        <TextBlock Grid.Row="6" Grid.Column="1" Text="{Binding VM.RdpPort}" Style="{StaticResource ImportantText}"  />
    </Grid>
</UserControl>
